package com.xiran.srpingboottemplateself.mapper;

import com.xiran.srpingboottemplateself.pojo.entity.Blog;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface BlogMapper {

    List<Blog> findPublicBlogs();

    Blog findByIdWithAuth(@Param("id") Long id, @Param("userId") Long userId);

    Blog selectById(@Param("id") Long id);

    List<Blog> selectByAuthorId(@Param("authorId") Long authorId);

    int insert(@Param("blog") Blog blog);

    int updateById(@Param("blog") Blog blog);

    int deleteById(@Param("id") Long id);

    List<Blog> selectAll();
}